package com.wowudi.controller;


import com.wowudi.dto.Result;
import com.wowudi.entity.Menu;
import com.wowudi.entity.RoleMenu;
import com.wowudi.service.RoleMenuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@Api(tags = "角色与菜单")
@RequestMapping("api/system/roleMenu")
public class RoleMenuController {

    @Autowired
    private RoleMenuService roleMenuService;

    @ApiOperation(value = "根据id查询")
    @GetMapping("getRoleMenuById/{id}")
    public Result updateMenu(@PathVariable int id){
        List<RoleMenu> roleMenuList = roleMenuService.findUserRoleById(id);
        Result result = new Result();
        if (roleMenuList!=null){
            result.setMessage("成功!");
            result.setData(roleMenuList);
        }
        else{
            result.setMessage("系统繁忙！");
            result.setCode(500);
        }
        return result;
    }


}
